{{ define "admin/manager/edit.html" }}
{{ template "admin/common/page_header.html" .}}

<div class="row">
    <div class="col-lg-12">
        <div class="card">
            <div class="card-body">
                <form action="/admin/manager/doEdit" method="post">
                    <input type="hidden" name="id" value="{{.manager.Id}}" />
                    <div class="form-group row">
                        <label class="col-sm-2 control-label" for="username">管理员名称</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="username" name="username" autocomplete="off" value="{{.manager.Username}}"  placeholder="管理员名称">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-2 control-label" for="password">管理员密码</label>
                        <div class="col-sm-10">
                            <input type="password" class="form-control" id="password" name="password"  placeholder="提示：为空表示不修改密码">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-2 control-label" for="mobile">管理员电话</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="mobile" name="mobile" value="{{.manager.Mobile}}" autocomplete="off" placeholder="管理员电话">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-2 control-label" for="email">管理员邮箱</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="email" name="email" autocomplete="off" value="{{.manager.Email}}" placeholder="管理员邮箱">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="col-sm-2 control-label" for="type">管理员角色</label>
                        <div class="col-sm-10">
                            <select name="role_id" id="role_id" class="form-control">
                                {{$roleId := .manager.RoleId}}
                                {{range $key,$value := .roleList}}
                                    {{if eq $value.Id $roleId}}
                                        <option selected value="{{$value.Id}}">{{$value.Title}}</option>
                                    {{else}}
                                        <option value="{{$value.Id}}">{{$value.Title}}</option>
                                    {{end}}
                                {{end}}
                            </select>
                        </div>
                    </div>
                    <div class="form-group col-md-12">
                        <button type="submit" class="btn btn-primary ajax-post" target-form="add-form">确 定</button>
                        <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);return false;">返 回</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

{{end}}